<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>[TITLE]</title>
        <?php include 'js-css.php'; ?>
    </head>

    <body>
        <div class="page">
        
            <div class="header_container"> 
                
                <div class="header">
    <?php
        $arrImages = $member->listNewestImage(4);
        if ($db->NumRows($arrImages) >=4 ) {
            ?>
            <div class="pic_container">
                <ul id="pic_slide">
                    <?php
                    $i=1;
                    while ($row = $db->FetchToArray($arrImages)) {
                        echo'
                    <li>
                        <a class="img_medium pic-'.$i.'" href="thanh-vien?mid=' . $row['mid'] . '&aid=' . $row['aid'] . '&image_id=' . $row['id'] . '&action=xemanh" target="_blank"><img src="' . $common->get_img_thumb($row['image']) . '" alt=""/></a>
                    </li>
                    ';
                        $i++;
                    }
                    ?>
                </ul>
            </div>
        <?php } ?>
                    <div id="logo"><a href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>"><img src="/images/logo.png" /></a></div>
                    <?php
                    $liCurrentImage = '';
                    $liCurrentFriend = '';
                    $liCurrentPersonal = '';
                    if ($action == 'xemalbum' || $action == 'anhcuatoi') {
                        $liCurrentImage = 'class="current"';
                    } elseif ($action == 'friend') {
                        $liCurrentFriend = 'class="current"';
                    } else {
                        $liCurrentPersonal = 'class="current"';
                    }
                    ?>
                    <div class="left">
                        <ul class="menu">
                            <?php
                            if ($member->checkLogin()) {
                                ?>
                                <li <?php echo $liCurrentPersonal; ?> ><a title="Trang cá nhân" class="mn_profile tooltip"  href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>"><p>Trang cá nhân</p></a></li>
                                <li <?php echo $liCurrentImage; ?> ><a title="Hình ảnh" class="mn_picture tooltip" href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>&action=xemalbum"><p>Hình ảnh</p></a></li>
                                <li <?php echo $liCurrentFriend; ?> ><a title="Bạn bè" class="mn_friend tooltip" href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>&action=friend"><p>Bạn bè</p></a></li>
                            <?php } else { ?>
                                <li <?php echo $liCurrentPersonal; ?> ><a title="Trang cá nhân" class="mn_profile tooltip"  href="javascript:;"><p>Trang cá nhân</p></a></li>
                                <li <?php echo $liCurrentImage; ?> ><a title="Hình ảnh" class="mn_picture tooltip" href="javascript:;"><p>Hình ảnh</p></a></li>
                                <li <?php echo $liCurrentFriend; ?> ><a title="Bạn bè" class="mn_friend tooltip" href="javascript:;"><p>Bạn bè</p></a></li>
                            <?php } ?>
                        </ul>
                        <div class="bgmenu">
                            <p class="srch-text-area">
                                <input type="text" autocomplete="off" value="Tìm kiếm" class="srch-text"  id="top_keyword" name="textfield" />
                                <input type="text" alt="Tìm kiếm"  class="srch-button" />
                            </p>
                            <div id="srch_display">
                                <div id="srch_li"></div>
                                <div class="display_box bottom" align="left">
                                    <img src="/images/loading31.gif" id="topsrch_loading" />
                                    <span class="view_more"">Xem thêm kết quả</span>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="right">

                        <div class="h_announce">
                            <?php
                            if ($member->checkLogin()) {
                                $numMsgUnRead = $member->countInbox();
                                $numNotifyUnRead = $member->countInbox('notification');
                                ?>
                                <ul>
                                    <li><a href="javascript:void(0)" target="_self" class="mn_announce"></a>
                                        <?php
                                        if ($numNotifyUnRead) {
                                            ?>
                                            <div class="notif-ctn">
                                                <span style="display: block;" id="pmcounter" class="ntcounter">
                                                    <span class="ntcounter-mid" id="pmcounter-mid"><?php echo $numNotifyUnRead; ?></span>
                                                </span>
                                            </div>
                                            <?php
                                        }
                                        ?>
                                        <div style="display: none" id="annpopup">
                                            <div class="ntpopup-overlap"></div>
                                            <div class="ntpopup-head" id="pmpopup-head">
                                                <div class="ntmin"></div>
                                                <strong>Thông báo</strong></div>
                                            <div align="left" id="notlist">
                                                <img src="/images/loading_small.gif" style="display:none;margin-left: 50px" id="not_loading" >
                                            </div>
                                        </div>
                                    </li>

                                    <li><a href="javascript:void(0)" target="_self" class="mn_message"></a>
                                        <?php
                                        if ($numMsgUnRead) {
                                            ?>
                                            <div class="notif-ctn">
                                                <span style="display: block;" id="pmcounter" class="ntcounter">
                                                    <span class="ntcounter-mid" id="pmcounter-mid"><?php echo $numMsgUnRead; ?></span>
                                                </span>
                                            </div>
                                            <?php
                                        }
                                        ?>
                                        <div style="display: none" id="msgpopup">
                                            <div class="ntpopup-overlap"></div>
                                            <div class="ntpopup-head" id="pmpopup-head">
                                                <div class="ntmin"></div>
                                                <strong><a href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>&action=hopthu" title="Hộp thư">Tin nhắn</a></strong></div>
                                            <div align="left" id="msglist">
                                                <img src="/images/loading_small.gif" style="display:none;margin-left: 50px" id="msg_loading" >
                                            </div>
                                        </div>
                                    </li>

                                    <li class="sub"><a href="javascript:void(0)" class="mn_account">Tài khoản<span class="arrow-bottom">&nbsp;</span></a>
                                        <div style="display: none" id="accpopup">
                                            <div class="ntpopup-overlap" style="width: 76px"></div>
                                            <ul >
                                                <li style="margin-top: 10px"><a href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>&action=suathongtincanhan">Cập nhật thông tin</a></li>
                                                <li><a href="/thanh-vien?action=thoat">Thoát</a></li>
                                            </ul>
                                        </div>
                                    </li>                               
                                </ul>
                            <?php } else { ?>
                                <ul>
                                    <li class="sub"><a href="javascript:void(0)" class="mn_login">Đăng nhập<span class="arrow-bottom">&nbsp;</span></a>
                                        <div style="display: none" id="loginpopup">
                                            <div class="ntpopup-overlap" style="width: 82px"></div>
                                            <form method="post" action="/dang-nhap">
                                                <div class="line_dn">
                                                    <?php
                                                    if ($member->checkRememberLogin() && !isset($_GET['taikhoankhac'])) {
                                                        ?>
                                                        <ul style="width: 300px;">
                                                            <li>
                                                                <div class="dn_l">Email</div>
                                                                <div class="dn_r">
                                                                    <b>
                                                                        <?php
                                                                        $arrParams = explode('|', $_COOKIE['saveLogin']);
                                                                        $email = $arrParams[0];
                                                                        $password = $arrParams[1];
                                                                        echo $email;
                                                                        ?>
                                                                    </b>
                                                                    <input type="hidden" name="email" value="<?php echo $email; ?>" style="border:0;" />
                                                                    <input type="hidden" name="password" value="<?php echo $password; ?>" style="border:0;" />
                                                                    <input type="hidden" name="rememberLogin" value="1" style="border:0;" />
                                                                </div>
                                                            </li>
                                                            <li>
                                                                <input type="submit" name="submitLogin" value="Đăng nhập" style="border:0; float:left; color:#FFF;" class="btnBlogComment" />
                                                                <font class="link">Đăng nhập với <a href="/dang-nhap?taikhoankhac=1">tài khoản khác</a></font>

                                                            </li>
                                                        </ul>
                                                        <?php
                                                    } else {
                                                        ?>
                                                        <ul>
                                                            <li>
                                                                <div class="dn_l">Email</div>
                                                                <div class="dn_r">
                                                                    <input type="text" style="width:200px;" value="" name="email">
                                                                </div>
                                                            </li>
                                                            <li>
                                                                <div class="dn_l">Mật khẩu</div>
                                                                <div class="dn_r">
                                                                    <input type="password" style="width:200px;" value="" name="password">
                                                                </div>
                                                            </li>
                                                            <li>
                                                                <div class="dn_l">&nbsp;</div>
                                                                <div class="dn_r">
                                                                    <input type="checkbox" style="border:0;" value="1" name="chkSaveLogin">
                                                                        <font>Ghi nhớ tôi</font>
                                                                </div>
                                                            </li>
                                                            <li>
                                                                <div class="dn_l">&nbsp;</div>
                                                                <div class="dn_r">
                                                                    <input type="submit" class="btnBlogComment" style="border:0; float:left; color:#FFF;" value="Đăng nhập" name="submitLogin"/>
                                                                    <font class="link"><a href="#">Quên mật khẩu ?</a></font>
                                                                </div>
                                                            </li>
                                                        </ul>
                                                        <?php
                                                    }
                                                    ?>
                                                </div>
                                            </form>
                                        </div>
                                    </li>
                                    <li ><a href="/dang-ky" class="mn_regist">Đăng ký</a>                                  
                                    </li>
                                </ul>
                            <?php } ?>
                        </div>
                        <!--
                        <div class="header_r_top">
                            <span>
                        <?php if ($_SESSION['client']['id']) { ?><a href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>"><b>Tài khoản</b></a> | <?php } ?>
                        <?php if (!isset($_SESSION['client']['id'])) { ?><a href="/dang-ky">Đăng ký</a>  or  <a href="/dang-nhap">Đăng nhập</a> <?php } ?>
                        <?php if ($_SESSION['client']['id']) { ?><a href="/thanh-vien?action=thoat">Thoát</a></span><?php } ?>
                        </div>
                        <div class="clear"></div>
                        -->

                    </div>
                </div>
            </div>
            <div class="wrapper-content">
                <script type="text/javascript">
                    $(document).ready(function(){
                        $(".tooltip").tipTip();
                    });
                    
                </script>
